package com.xmy.cultivate.mapper;

import com.xmy.cultivate.entity.OrganizationDepartment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 组织部门 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2025-04-28
 */
public interface OrganizationDepartmentMapper extends BaseMapper<OrganizationDepartment> {

    @Select({"<script>",
            "SELECT ",
            "t1.school_id, ",
            "t2.name as school_name ",
            "FROM ",
            "organization_department t1 ",
            "LEFT JOIN organization t2 ON t1.school_id = t2.id ",
            "WHERE t1.`status` = 1",
            "GROUP BY ",
            "t1.school_id, ",
            "t2.name ",
            "</script>"})
    public List<OrganizationDepartment> getSchool();

}
